﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using VCN.App.DataTransferObjects;
namespace VCN.App.DataAccessLayer
{
    public class GetInTouchDAO: BasicDAO<GetInTouch>
    {
        public List<GetInTouch> selectByTypeList(int ip_type)
        {
            return exeConvert(GetData("[sp_tblGetInTuoch_SelectByType]", "@Type", ip_type));
        }

        public List<GetInTouch> selectAllList()
        {
            return exeConvert(selectAll2Dt(new GetInTouch()));
        }

        public List<GetInTouch> exeConvert(System.Data.DataTable ip_dt)
        {
            if (ip_dt == null)
            {
                return null;
            }
            else
            {
                List<GetInTouch> op_result = new List<GetInTouch>();
                for (int i = 0; i < ip_dt.Rows.Count; i++)
                {
                    op_result.Add(new GetInTouch(int.Parse(ip_dt.Rows[i]["ID"].ToString()), ip_dt.Rows[i]["INFORMATION"].ToString(), ip_dt.Rows[i]["IMAGE"].ToString(), int.Parse(ip_dt.Rows[i]["TYPE"].ToString())));
                }
                return op_result;
            }
        }


        public override System.Collections.Generic.List<GetInTouch> selectAll2List(GetInTouch ip_obj)
        {
            throw new NotImplementedException();
        }

        public override bool insert(GetInTouch ip_obj)
        {
            throw new NotImplementedException();
        }

        public override bool update(GetInTouch ip_obj)
        {
            throw new NotImplementedException();
        }
    }
}
